<%-- 
    Document   : login
    Created on : Jan 2, 2013, 7:38:16 PM
    Author     : Neves
--%>

<%@page import="java.util.Iterator"%>
<%@page import="java.util.List"%>
<%@page import="db_interaction.Utilizador"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <%
            Utilizador utilizador = new Utilizador();

            String email = request.getParameter("email_user");
            String pass_user = request.getParameter("pass_user");

            Utilizador ut = utilizador.SelectUserV2(email, pass_user);

            if (ut == null) {
                response.sendRedirect("/TheHive/login/index.jsp");
                return;
            }
            session.setAttribute("name", ut.getNome());
            session.setAttribute("id_user", ut.getid());
            session.setAttribute("email", email);

            response.sendRedirect("/TheHive/publications/index.jsp");




        %>
    </body>
</html>
